package com.michael.demos.springboot.satoken.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2020/9/22 16:16
 */
@RequestMapping("/test")
@RestController
public class TestController {

    //@SaCheckLogin
    //@SaCheckRole("admin")
    @GetMapping("/userAdd")
    @SaCheckPermission("user-add")
    public String userAdd() {
        return "SUCCESS";
    }

    @GetMapping("/userDel")
    @SaCheckPermission("user-del")
    public String userDel() {
        return "SUCCESS";
    }

    @GetMapping("/admin")
    @SaCheckRole("admin")
    public String needAdmin() {
        return "SUCCESS";
    }

    @GetMapping("/dev")
    @SaCheckRole("dev")
    public String needDev() {
        return "SUCCESS";
    }

}
